package com.site.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.site.domain.UserInfo;
import com.site.persistence.UserInfoMapper;
import com.site.service.UserService;

/**
 * Purpose: 用户信息
 * @author: liangjun
 * @since: JDK 1.6
 * @date: 2015年5月25日
 */
@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserInfoMapper userInfoMapper;

	public UserInfo getUserInfoByName(String userName) throws Exception {
		UserInfo userInfo = null;
		userInfo = userInfoMapper.getUserInfoByUserName(userName);
		return userInfo;
	}
	
	/**
	 * Purpose: 修改密码
	 * @author: liangjun
	 * @param userId
	 * @throws Exception
	 * @return: void
	 */
	@Transactional
	public void updateUserInfoByUserId(int userId, String password) throws Exception {
		userInfoMapper.updateUserInfoByUserId(userId, password);
	}
	
}
